/////////////////////////////////////////////
// CMARectWindow custom object.

#if !defined(ARX__CMARECTWINDOW_H__19990720_184845)
#define ARX__CMARECTWINDOW_H__19990720_184845

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning(disable: 4275 4251)

#ifdef _CH8_5_
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP 
#endif

#ifndef CMACH8_5_DBXSERVICE
#define CMACH8_5_DBXSERVICE "CMACH8_5_DBXSERVICE"
#endif



#include "dbmain.h"


class DLLIMPEXP CMARectWindow : public AcDbEntity
{
public:

	ACRX_DECLARE_MEMBERS(CMARectWindow);

	// Constructor / Destructor
	CMARectWindow();
	virtual ~CMARectWindow();

	//{{AFX_ARX_METHODS(CMARectWindow)
	virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
	virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
	virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
	virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
	virtual Adesk::Boolean worldDraw(AcGiWorldDraw* mode);
	virtual Acad::ErrorStatus explode(AcDbVoidPtrArray& entitySet) const;
	virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);
	virtual void list() const;
	virtual Acad::ErrorStatus moveStretchPointsAt(const AcDbIntArray& indices,
												  const AcGeVector3d& offset);
	virtual Acad::ErrorStatus getStretchPoints(AcGePoint3dArray& stretchPoints) const;
	virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices,
											   const AcGeVector3d& offset);
	virtual Acad::ErrorStatus getGripPoints(AcGePoint3dArray& gripPoints,
											AcDbIntArray& osnapModes,
											AcDbIntArray& geomIds) const;
	virtual Acad::ErrorStatus getOsnapPoints(AcDb::OsnapMode osnapMode,
											 int gsSelectionMark,
											 const AcGePoint3d& pickPoint,
											 const AcGePoint3d& lastPoint,
											 const AcGeMatrix3d& viewXform,
											 AcGePoint3dArray& snapPoints,
											 AcDbIntArray& geomIds) const;
	//}}AFX_ARX_METHODS

	void setWindowRows(Adesk::Int32 rowQty);
	void setWindowCols(Adesk::Int32 colQty);
	void setWindowHeight(double windHeight);
	void setWindowLength(double windLength);
	void setWindowStartPoint(AcGePoint3d lowLeftPoint);

	double getWindowLength() const;
	double getWindowHeight() const;

	Adesk::Int32 getWindowRows() const;
	Adesk::Int32 getWindowCols() const;

	AcGePoint3d getWindowStartPoint() const;



	//{{AFX_ARX_DATA_ACCESS(CMARectWindow)
	//}}AFX_ARX_DATA_ACCESS

	char m_strWindType[10];


private:
	//{{AFX_ARX_DATA(CMARectWindow)
	//}}AFX_ARX_DATA

	Acad::ErrorStatus osnapEnd(const AcGePoint3d& pickPoint,
							   AcGePoint3dArray& snapPoints) const;

	Acad::ErrorStatus osnapMid(const AcGePoint3d& pickPoint,
							   AcGePoint3dArray& snapPoints) const;

	Acad::ErrorStatus osnapCen(const AcGePoint3d& pickPoint,
							   AcGePoint3dArray& snapPoints) const;

	
	Adesk::Int32 m_nrows;
	Adesk::Int32 m_ncols;
	double m_drectFrameLen;
	double m_drectFrameHt;
	AcGePoint3d m_lowLeftPt;



private:

	void *operator new[](unsigned nSize) { return 0; }
	void operator delete[](void *p) {};
	void *operator new[](unsigned nSize, const char *file, int line) { return 0; }

};



#endif // !defined(ARX__CMARECTWINDOW_H__19990720_184845)